package com.tjsinfo.tjsoa.system.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.json.JSONObject;
import com.tjsinfo.tjsoa.common.SessionUser;
import com.tjsinfo.tjsoa.system.bo.ISystemUserBo;
import com.tjsinfo.tjsoa.system.vo.TSystemUser;
import com.tjsinfo.tjsoa.workflow.WorkFlowTemplate;

public class DaiBanAction  extends Action{
	private ISystemUserBo systemUserBo;
	
	public ISystemUserBo getSystemUserBo() {
		return systemUserBo;
	}

	public void setSystemUserBo(ISystemUserBo systemUserBo) {
		this.systemUserBo = systemUserBo;
	}

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		Integer shouwendaiban = 0;
		String userid =  String.valueOf(SessionUser.getUser(request).getUser_id());
		shouwendaiban +=  systemUserBo.selectTask(userid, "党委收文");
		shouwendaiban += systemUserBo.selectTask(userid, "行政收文");
		
		Integer fawendaiban = 0;
		fawendaiban += systemUserBo.selectTask(userid, "党委发文");
		fawendaiban += systemUserBo.selectTask(userid, "行政发文");
		
		Integer huiyidaiban=0;
		huiyidaiban+= systemUserBo.selectHuiyi(userid,userid,userid); //会议管理
		
		JSONObject object = new JSONObject();
    	object.put("shouwendaiban", shouwendaiban);
    	object.put("fawendaiban", fawendaiban);
    	object.put("huiyidaiban", huiyidaiban);
    	response.getWriter().print(object);
		return null;
	}
}
